package com.zbcz.crm.network

import com.zbcz.crm.bean.Acceptance
import com.zbcz.crm.bean.ContractBean
import com.zbcz.crm.bean.Accessories
import com.zbcz.crm.bean.AccessoriesRelated
import com.zbcz.crm.bean.AuditBean
import com.zbcz.crm.bean.Customer
import com.zbcz.crm.bean.BaseBean
import com.zbcz.crm.bean.Contacts
import com.zbcz.crm.bean.DictItem
import com.zbcz.crm.bean.FollowUpRecord
import com.zbcz.crm.bean.InvitedBean
import com.zbcz.crm.bean.LoginRequestBean
import com.zbcz.crm.bean.LoginResult
import com.zbcz.crm.bean.PagerWrapper
import com.zbcz.crm.bean.PaymentBackBean
import com.zbcz.crm.bean.ProductBean
import com.zbcz.crm.bean.ProjectBean
import com.zbcz.crm.bean.ProjectEstablishment
import com.zbcz.crm.bean.ProjectFileBean
import com.zbcz.crm.bean.Tender
import com.zbcz.crm.bean.VisitData
import com.zbcz.crm.bean.WinningBidBean
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface CrmApi {

    @POST("/jeecg-boot/sys/mLogin")
    suspend fun login(@Body loginRequestBean: LoginRequestBean): BaseBean<LoginResult>

    @GET("/jeecg-boot/visit/visitMessage/list")
    suspend fun getVisitList(
        @Query("visitDate") visitDate: String?,
        @Query("visitOrderStatus") visitOrderStatus: String?,
        @Query("visitorName") visitorName: String?,
        @Query("token") token: String?
    ): BaseBean<List<VisitData>>

    @GET("/jeecg-boot/visit/visitMessage/list")
    suspend fun getVisitList(
        @Query("token") token: String?
    ): BaseBean<List<VisitData>>

    @GET("/jeecg-boot/visit/visitMessage")
    suspend fun getVisitDetails(@Query("visitorId") visitorId: String?): BaseBean<VisitData>

    @POST("/jeecg-boot/visit/submitOrder")
    suspend fun subMitOrder(
        @Body submitRequest: VisitData, @Query("token") token: String?
    ): BaseBean<Object>

    @POST("/jeecg-boot/visit/agree")
    suspend fun agreeOrder(
        @Query("visitorId") visitorId: String, @Query("visitArea") visitArea: String
    ): BaseBean<Object>

    @POST("/jeecg-boot/visit/disagree")
    suspend fun disagreeOrder(
        @Query("visitorId") visitorId: String, @Query("visitArea") visitArea: String
    ): BaseBean<Object>

    @POST("/jeecg-boot/zbmarketingmanagercustomer/zbMarketingManagerCustomer/add")
    suspend fun addCustomer(
        @Body customer: Customer,
        @Query("token") token: String?
    ): BaseBean<Object>

    @GET("/jeecg-boot/zbmarketingmanagercustomer/zbMarketingManagerCustomer/list")
    suspend fun queryCustomerList(
        @Query("token") token: String?,
        @Query("pageNo") pageNo: Int,
        @Query("pageSize") pageSize: String?
    ): BaseBean<PagerWrapper<Customer>>

    @POST("/jeecg-boot/zbmarketingmanagercontact/zbMarketingManagerContact/add")
    suspend fun addContacts(
        @Query("token") token: String?,
        @Body() contacts: Contacts
    ): BaseBean<Object>

    @GET("/jeecg-boot/sys/dict/getDictItems/{dictCode}")
    suspend fun getDictItems(
        @Path("dictCode") dictCode: String,
        @Query("token") token: String?,
    ): BaseBean<List<DictItem>>

    @GET("jeecg-boot/zbproject/zbproject/list")
    suspend fun queryProjectList(
        @Query("token") token: String?,
        @Query("projectName") projectName: String?,
        @Query("projectType") projectType: String?,
    ): BaseBean<PagerWrapper<ProjectBean>>

    @GET("/jeecg-boot/zbproduct/zbProduct/list")
    suspend fun queryProductList(
        @Query("token") token: String?,
        @Query("productName") productName: String?,
        @Query("productType") productType: String?,
    ): BaseBean<PagerWrapper<ProductBean>>

    @GET("/jeecg-boot/zbaccessory/zbAccessory/queryByProductId")
    suspend fun queryByProductId(
        @Query("token") token: String?,
        @Query("productId") productId: String?,
    ): BaseBean<PagerWrapper<AccessoriesRelated>>


    @GET("/jeecg-boot/zbproject/zbprojectfollow/list")
    suspend fun queryProductAccessory(
        @Query("token") token: String?,
        @Query("accessoryName") accessoryName: String?,
    ): BaseBean<PagerWrapper<Accessories>>

    @GET("/jeecg-boot/zbproject/zbprojectfollow/list")
    suspend fun queryFollowUpList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<FollowUpRecord>>

    @GET("/jeecg-boot/zbproject/zbprojectapproval/list")
    suspend fun queryProjectEstablishmentList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<ProjectEstablishment>>

    @GET("/jeecg-boot/zbproject/zbprojectinvite/list")
    suspend fun queryInvitedBeanList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<InvitedBean>>

    @GET("/jeecg-boot/zbproject/zbprojectbid/list")
    suspend fun queryTenderList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<Tender>>

    @GET("/jeecg-boot/zbproject/zbprojectwinningbid/list")
    suspend fun queryWinningBidList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<WinningBidBean>>


    @GET("/jeecg-boot/zbproject/zbprojectcontract/list")
    suspend fun queryContractList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<ContractBean>>

    @GET("/jeecg-boot/zbproject/zbprojectcheck/list")
    suspend fun queryAcceptanceList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<Acceptance>>

    @GET("/jeecg-boot/zbproject/zbprojectaudit/list")
    suspend fun queryAuditList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<AuditBean>>

    @GET("/jeecg-boot/zbproject/zbprojectpayment/list")
    suspend fun queryPaymentBackList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<PaymentBackBean>>

    @GET("/jeecg-boot/zbproject/zbprojectfile/list")
    suspend fun queryProjectFileList(
        @Query("token") token: String?,
        @Query("projectId") projectId: String?,
    ): BaseBean<PagerWrapper<ProjectFileBean>>
}